#ifndef BOOK_DATA_H
#define BOOK_DATA_H

#include <memory>
#include <QStringList>

#include "fileinfo.h"
#include "description.h"
#include "paragraph/base.h"

namespace Book {

class Data
{
    public:

        Data (const FileInfo& _fileInfo, const char* _formatName)
            : m_FileInfo(_fileInfo),
              m_FormatName(_formatName) {}

        const FileInfo& GetFileInfo () const
            { return m_FileInfo; }

        void SetDescription (const Description& _description)
            { m_Description = _description; }

        const Description& GetDescription () const
            { return m_Description; }

        const char* GetFormatName () const
            { return m_FormatName; }

        void AddParagraph (Paragraph::SharedPtr _paragraph)
            { m_Paragraphs.push_back(_paragraph); }

        Paragraph::ListIterator BrowseParagraphs () const
            { return Paragraph::ListIterator(m_Paragraphs); }

    private:

        const FileInfo m_FileInfo;

        const char* const m_FormatName;

        Description m_Description;

        Paragraph::List m_Paragraphs;
};

typedef std::auto_ptr<Data> DataPtr;

}

#endif // BOOK_DATA_H
